﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL.Progect;
using System.Data;
using BLL.Order;

namespace HQWeb.View.Order
{
    public partial class Payment : BasePage
    {

        Model.Order.T_PUB_ORDER modell = new Model.Order.T_PUB_ORDER();
        T_PUB_ORDER BLL = new T_PUB_ORDER();

        protected void Page_Load(object sender, EventArgs e)
        {
            VerdictIsLogin();
            if (!IsPostBack)
            {
                binddata();
            }
        }
        public void binddata()
        {
            string strid = Request["id"];
            modell = BLL.GetModelByID(strid);
            labrealtoal.Text = modell.RealToal.ToString();
            labtotal.Text = modell.Total.ToString();
            labchaen.Text = (modell.RealToal - modell.Total).ToString();
        }

        protected void butbaocun_Click(object sender, EventArgs e)
        {
            string strid = Request["id"];
            modell = BLL.GetModelByID(strid);
            decimal money;
            string strMoney = texpayment.Text.Trim();
            decimal.TryParse(strMoney,out money);
            string strOther = texremark.Text.Trim();
            BLL.UpdateMoney(money, strid, Session["USER_ID"].ToString(), strOther);
            Universal.JS.RunJS("  Close();");
        }
    }
}